package ru.st.selenium.old_homework;
import org.testng.Assert;
import org.testng.annotations.Test;

import mainPackage.EditorMoviePage;
import mainPackage.LoginPage1;
import mainPackage.MainPage;
import mainPackage.UploadFilePage;

public class MoviesSearch extends ru.st.selenium.pages.TestBase{

	
	@Test(priority=1)
	public void searchFilePositive() {
		
		System.out.println("TEST1: Search file. Positive case ..... ");
		
		MainPage mainpage = new MainPage(driver, baseUrl);
		
		LoginPage1 loginpage = mainpage.goToTheNextPage();
		
		Assert.assertNotNull(loginpage,"It does not matter to go to the next step, because on the first step there was an error!");
		
		UploadFilePage uploadpage = loginpage.goToTheNextStep("admin","admin");
		
		Assert.assertNotNull(uploadpage,"There was an error during login on page!");
		
		Assert.assertTrue(uploadpage.searchMovie("78"), "No one file was not found!");
		
		System.out.println("TEST1: FINISH");
}
	
	@Test(priority=2)
	public void searchFileNegative()  {
		
		System.out.println("TEST2: Search file. Negative case ..... ");
		
		MainPage mainpage = new MainPage(driver, baseUrl);
		
		LoginPage1 loginpage = mainpage.goToTheNextPage();
		
		Assert.assertNotNull(loginpage,"It does not matter to go to the next step, because on the first step there was an error!");
		
		UploadFilePage uploadpage = loginpage.goToTheNextStep("admin","admin");
		
		Assert.assertNotNull(uploadpage,"There was an error during login on page!");
				
		Assert.assertTrue(uploadpage.searchMovie("-!*-*"), "No one file was not found!");
		
		System.out.println("TEST2: FINISH");
}
	
}